BUZZER INTERFACING WITH ARDUINO
Buzzers are those devices which produce a sound between 1 to 8Khz with vibrating a piezo element or a small speaker with a metal diaphragm. In this tutorial you will learn how to use a buzzer or piezo speaker with Arduino (by using ATmega 328p).
Synopsis

Buzzer is an electrical device that makes a buzzing noise and is used for signalling. They are widely used in timers, alarms, electronics toys, computers, telephones and other products where generation of sound is required.

In this tutorial you will learn how to use a buzzer or piezo speaker with Arduino (by using ATmega 328p).

Description

Buzzers are those devices which produce a sound between 1 to 8Khz with vibrating a piezo element or a small speaker with a metal diaphragm.

Basically there are two types of Buzzers. One with a bult in oscillator to produce an audible sound, other without the Oscillator.

Working of a Buzzer:

Piezo Buzzer mainly consists of a multi-vibrator circuit, piezoelectric buzzer films, and the resonance box, shell etc. Multivibrator constits of transistors or integrated circuits. When switched on, after (1.5 ~ 15V DC working voltage), multi-harmonic oscillator start-up, output 1.5 ~ 2.5kHZ of audio signals, which results in audible sound.

Piezoelectric Buzzer contains zirconate titanate films from lead or lead magnesium niobate piezoelectric ceramic materials. On both sides of the ceramic coating on the silver electrode by polarization and aging treatment, and then with the brass plates or stainless steel sheets stick together.

Electromagnetic Buzzer works from the oscillator, the electromagnetic coil, magnet, diaphragm and shell so on. After power on, the audio oscillator signal current through the electromagnetic coil, so that the electromagnetic coil produces a magnetic field. Diaphragm in the electromagnetic coil and magnet interaction, periodically vibrating voice and thus the audible note.

There are too Electromagnetic Buzzers which works without any oscillator. These work by the frequency produced by the make and break contacts to the coil in relation to the moving diaphragm.

There are too Electromagnetic Buzzers which works without any oscillator. These work by the frequency produced by the make and break contacts to the coil in relation to the moving diaphragm.

ATmega 328p

The Atmel 8-bit AVR RISC-based microcontroller combines 32KB ISP flash memory with read-while-write capabilities, 1KB EEPROM, 2KB SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible timer/counters with compare modes, internal and external interrupts, serial programmable USART, a byte-oriented 2-wire serial interface, SPI serial port, 6-channel 10-bit A/D converter (8-channels in TQFP and QFN/MLF packages), programmable watchdog timer with internal oscillator, and five software selectable power saving modes. The device operates between 1.8 to 5.5 volts. The device achieves throughout approaching 1 MIPS per MHz.

VCC: Digital supply voltage.

RESET: If the RSTDISBL fuse is programmed, PC6 is used as an input pin. If the RSTDISBL fuse is not programmed, PC6 is used as a reset input. A low level on this pin for longer than the minimum pulse length will generate a reset.

AVCC is the supply voltage pin for the A/D converter. It should be externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be connected to VCC through a low-pass filter.

Port B (PB7:0) XTAL1/XTAL2/TOSC1/TOSC2 is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port B output buffers have symmetrical drive characteristics with both high sink and source capability.

Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The port D output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, port D pins that are externally pulled low will source current if the pull-up resistors are activated. The port D pins are tri-stated when a reset condition becomes active, even if the clock is not running.

Depending on the clock selection fuse settings, PB6 can be used as input to the inverting oscillator amplifier and input to the internal clock operating circuit.

Depending on the clock selection fuse settings, PB7 can be used as output from the inverting oscillator amplifier.

Proteus design for Buzzer interfacing with Arduino


Orcad design for Buzzer Interfacing with Arduino


Buzzer interfacing with Arduino

/* Name : main.c
* Purpose : Source code for Buzzer Interfacing with Arduino.
* Author : Gemicates
* Date : 22-01-2018
* Website : www.gemicates.org
* Revision : None
*/
#include <Arduino.h>
const int buzzerPin = 11;             // declaring the PWM pin
void setup()
{
pinMode(buzzerPin, OUTPUT);           //initialize the digital pin as an Output
}
void loop()
{
digitalWrite(buzzerPin, HIGH);        // switch buzzer ON by making the voltage level HIGH
delay(100);                           // function call for delay
digitalWrite(buzzerPin, LOW);         // switch buzzer OFF by making the voltage LOW
delay(100);                           // function call for delay
}

Error message here!

Show Error message here!


Forgot your password?

Error message here!

Send OTP

Error message here!

Show Error message here!


Lost your password? Please enter your email address. You will receive a password you Need.

Send Error message here!


Back to log-in

Close